-
Notifications
You must be signed in to change notification settings - Fork 3.9k
baggage propagation #12389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
baggage propagation #12389
Conversation
|
The issue was that it didn't propagate to metrics... but you don't test metrics. I'd expect changes to grpc-java/opentelemetry/src/main/java/io/grpc/opentelemetry/OpenTelemetryMetricsModule.java Line 131 in 0567531
This can be considered a good step, as it is now propagated to the application. Basically, when you say "propagation" you need to say what you are propagating to. But this would only be one part of what had been discussed earlier. (And this can go in before the rest of the metrics is working.) |
d4e86d7 to
8f61af3
Compare
| Context serverCallContext = Context.current(); | ||
| serverCallContext = serverCallContext.with(span); | ||
| Baggage baggage = BAGGAGE_KEY.get(io.grpc.Context.current()); | ||
| if (baggage != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it was never set...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How could it be never set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not present in the header...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, so we are getting it from the grpc context which uses
/**
* Get the value from the specified context for this key.
*/
@SuppressWarnings("unchecked")
public T get(Context context) {
T value = (T) PersistentHashArrayMappedTrie.get(context.keyValueEntries, this);
return value == null ? defaultValue : value;
}
and can return null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it is added unconditionally to the context earlier, so it shouldn't be missing. If it is missing, that seems like a bug, and something we'd want to know about. Seems we should do something, other than ignore it.
opentelemetry/src/main/java/io/grpc/opentelemetry/OpenTelemetryMetricsModule.java
Outdated
Show resolved
Hide resolved
ejona86
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When merging, fix the commit title to start with "opentelemetry:" and include any relevant details in the description. For example, there is an internal bug for this, so that should be included in the commit message.
9499261 to
154e7c1
Compare
…lps with b/406058193 (grpc#12389)
No description provided.